class CreateComponents < ActiveRecord::Migration
  def self.up
    create_table :components do |t|
      t.column :name, :string
      t.column :title, :string
      t.column :body, :text
      t.column :project_id, :integer
      t.column :template_id, :integer
    end

    create_table :components_images, :id => false do |t|
      t.column :component_id, :integer, :nullable => false
      t.column :image_id, :integer, :nullable => false
    end
  end

  def self.down
    drop_table :components
  end
end
